I'm trying to replace plain text "TM" with superscripted "TM" in object text and want to preserver the rest of the rich text formatting. I am able to create the rich text replacement string so that if I set the object text to newtxt, I see the superscripting. However, if I invoke replaceRichText passing in the original rich string object text and have it replace the ROMEOTM with newstring, it doesn't display the superscripting when I set object text to the resulting string. I'm getting an extra backslash in the object text. I had this working at one time, but lost the script to do it. And old age must be setting in because for the life of me, I can't get it to work again. Any ideas what I'm doing wrong? Here is the code... |
Re: replaceRichText with richText otxt = replaceRichText(otxt, strt, len, newtxt) I used... otxt = otxt0:strt-1 newtxt otxtstrt+len:length(otxt)-1 This worked. Does anyone have a better suggestion? |
Re: replaceRichText with richText In the old days I had to convert the rich text to raw text; then search the raw text and use the position and offset into cutRichText. I suppose I'll give "findRichText" and "replaceRichText" another try. I believe this is a better replacement string which only matters if (unlikely) "ROMEO" was already superscripted.
-Louie |
Re: replaceRichText with richText Jagtattoo - Tue Feb 05 23:02:40 EST 2013 Seems though Buffers would work more effeciently -Louie |